--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  F:\Dropbox\School\Research Projects\Populism\Analysis\PANAS PAPER\Replication code\analysis.log
  log type:  text
 opened on:   4 Dec 2019, 16:23:36

. 
. ****MANUSCRIPT*****
. *TABLE 1
. use "study2_prepped.dta", clear

. reg ppl anger1 fear1

      Source |       SS           df       MS      Number of obs   =       492
-------------+----------------------------------   F(2, 489)       =      3.73
       Model |  4.34112231         2  2.17056115   Prob > F        =    0.0247
    Residual |  284.674702       489  .582156854   R-squared       =    0.0150
-------------+----------------------------------   Adj R-squared   =    0.0110
       Total |  289.015824       491  .588626933   Root MSE        =    .76299

------------------------------------------------------------------------------
         ppl |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      anger1 |  -.1919695    .089503    -2.14   0.032    -.3678274   -.0161115
       fear1 |   .1126503   .0884001     1.27   0.203    -.0610406    .2863413
       _cons |   .0152928   .0343988     0.44   0.657    -.0522948    .0828805
------------------------------------------------------------------------------

. vif

    Variable |       VIF       1/VIF  
-------------+----------------------
      anger1 |      6.07    0.164708
       fear1 |      6.07    0.164708
-------------+----------------------
    Mean VIF |      6.07

. reg ppl anger2 fear2

      Source |       SS           df       MS      Number of obs   =       495
-------------+----------------------------------   F(2, 492)       =      1.78
       Model |   1.9004444         2  .950222202   Prob > F        =    0.1697
    Residual |  262.606977       492  .533754017   R-squared       =    0.0072
-------------+----------------------------------   Adj R-squared   =    0.0031
       Total |  264.507421       494  .535440123   Root MSE        =    .73058

------------------------------------------------------------------------------
         ppl |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      anger2 |   .0727723   .0438065     1.66   0.097    -.0132985    .1588431
       fear2 |  -.0113133   .0475403    -0.24   0.812    -.1047204    .0820938
       _cons |  -.0154204   .0328375    -0.47   0.639    -.0799394    .0490987
------------------------------------------------------------------------------

. vif

    Variable |       VIF       1/VIF  
-------------+----------------------
      anger2 |      1.51    0.661846
       fear2 |      1.51    0.661846
-------------+----------------------
    Mean VIF |      1.51

. 
. *FIGURE3
. 
. use "study1_prepped.dta", clear

. ci2 anger fear, corr

Confidence interval for Pearson's product-moment correlation 
of anger and fear, based on Fisher's transformation.
Correlation = 0.833 on 778 observations (95% CI: 0.810 to 0.854)

. ci2 anger2 fear2, corr

Confidence interval for Pearson's product-moment correlation 
of anger2 and fear2, based on Fisher's transformation.
Correlation = 0.881 on 364 observations (95% CI: 0.855 to 0.902)

. ci2 anger3 fear3, corr

Confidence interval for Pearson's product-moment correlation 
of anger3 and fear3, based on Fisher's transformation.
Correlation = 0.269 on 357 observations (95% CI: 0.169 to 0.362)

. 
. use "study2_prepped.dta", clear

. ci2 anger fear, corr

Confidence interval for Pearson's product-moment correlation 
of anger and fear, based on Fisher's transformation.
Correlation = 0.759 on 987 observations (95% CI: 0.731 to 0.784)

. ci2 anger1 fear1, corr

Confidence interval for Pearson's product-moment correlation 
of anger1 and fear1, based on Fisher's transformation.
Correlation = 0.914 on 492 observations (95% CI: 0.898 to 0.927)

. ci2 anger2 fear2, corr

Confidence interval for Pearson's product-moment correlation 
of anger2 and fear2, based on Fisher's transformation.
Correlation = 0.582 on 495 observations (95% CI: 0.520 to 0.637)

. 
. *Graph produced manually in excel
. 
. *Table 2 is in Mplus
. 
. *Table 3
. 
. use "study2_prepped.dta", clear

. drop anger fear

. gen anger = .
(987 missing values generated)

. replace anger = anger1 if panasv == 1
(492 real changes made)

. replace anger = anger2 if panasv == 2
(495 real changes made)

. 
. gen fear = .
(987 missing values generated)

. replace fear = fear1 if panasv == 1
(492 real changes made)

. replace fear = fear2 if panasv == 2
(495 real changes made)

. 
. gen angfeardiff = anger-fear

. 
. label define panasv 1 "Standard" 2 "Modified"

. label value panasv panasv

. 
. label define treat 0 "Control" 1 "Anger" 2 "Fear" 

. label value treat treat

. 
. by treat, sort: ttest angfeardiff, by(panasv) unequal

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treat = Control

Two-sample t test with unequal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Standard |     150    .0468575    .0123184    .1508684    .0225163    .0711987
Modified |     175    .0713202    .0172176    .2277676     .037338    .1053025
---------+--------------------------------------------------------------------
combined |     325    .0600297    .0108808    .1961556    .0386239    .0814356
---------+--------------------------------------------------------------------
    diff |           -.0244627    .0211705               -.0661216    .0171962
------------------------------------------------------------------------------
    diff = mean(Standard) - mean(Modified)                        t =  -1.1555
Ho: diff = 0                     Satterthwaite's degrees of freedom =   304.54

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.1244         Pr(|T| > |t|) = 0.2488          Pr(T > t) = 0.8756

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treat = Anger

Two-sample t test with unequal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Standard |     174    .1086208    .0346445    .4569926    .0402404    .1770011
Modified |     160    .2386394    .0818541    1.035382    .0769778     .400301
---------+--------------------------------------------------------------------
combined |     334    .1709052    .0432439    .7903117    .0858394    .2559709
---------+--------------------------------------------------------------------
    diff |           -.1300187    .0888839               -.3052153    .0451779
------------------------------------------------------------------------------
    diff = mean(Standard) - mean(Modified)                        t =  -1.4628
Ho: diff = 0                     Satterthwaite's degrees of freedom =  214.735

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0725         Pr(|T| > |t|) = 0.1450          Pr(T > t) = 0.9275

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treat = Fear

Two-sample t test with unequal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Standard |     168   -.1552388    .0332423    .4308688    -.220868   -.0896096
Modified |     160   -.3240591    .0688028    .8702942   -.4599443   -.1881738
---------+--------------------------------------------------------------------
combined |     328   -.2375902    .0378635     .685738    -.312077   -.1631033
---------+--------------------------------------------------------------------
    diff |            .1688203    .0764125                .0182621    .3193784
------------------------------------------------------------------------------
    diff = mean(Standard) - mean(Modified)                        t =   2.2093
Ho: diff = 0                     Satterthwaite's degrees of freedom =  229.966

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9859         Pr(|T| > |t|) = 0.0281          Pr(T > t) = 0.0141

. 
. ****APPENDIX****
. 
. *Runs the balance stats for everything
. 
. *TABLE A1
. *Study1 
. use "study1_prepped.dta", clear

. sem (FEAR -> afraid anxious) (ANGER ->angry hostile) (NEGAFF-> ashamed upset distressed), /*
> */ var(FEAR@1 ANGER@1 NEGAFF@1) cov(e.angry*e.upset) cov(e.ashamed*e.angry) cov(e.hostile*e.ashamed) cov(e.afraid*e.ashamed) method(mlmv) standardized
(58 all-missing observations excluded)

Endogenous variables

Measurement:  afraid anxious angry hostile ashamed upset distressed

Exogenous variables

Latent:       FEAR ANGER NEGAFF

Fitting saturated model:

Iteration 0:   log likelihood = -6931.8823  
Iteration 1:   log likelihood = -6931.8182  
Iteration 2:   log likelihood = -6931.8182  

Fitting baseline model:

Iteration 0:   log likelihood =  -7955.871  
Iteration 1:   log likelihood = -7955.8706  

Fitting target model:

Iteration 0:   log likelihood =  -7449.078  (not concave)
Iteration 1:   log likelihood = -7056.1745  (not concave)
Iteration 2:   log likelihood = -6965.5388  
Iteration 3:   log likelihood = -6953.5625  
Iteration 4:   log likelihood = -6939.3425  
Iteration 5:   log likelihood = -6938.6822  
Iteration 6:   log likelihood = -6938.6802  
Iteration 7:   log likelihood = -6938.6802  

Structural equation model                       Number of obs     =        720
Estimation method  = mlmv
Log likelihood     = -6938.6802

 ( 1)  [/]var(FEAR) = 1
 ( 2)  [/]var(ANGER) = 1
 ( 3)  [/]var(NEGAFF) = 1
-----------------------------------------------------------------------------------------
                        |                 OIM
           Standardized |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
Measurement             |
  afraid                |
                   FEAR |   .7806436   .0232258    33.61   0.000     .7351218    .8261654
                  _cons |   1.565076   .0555819    28.16   0.000     1.456138    1.674015
  ----------------------+----------------------------------------------------------------
  anxious               |
                   FEAR |   .7206721   .0247551    29.11   0.000     .6721529    .7691912
                  _cons |   1.643951   .0571461    28.77   0.000     1.531946    1.755955
  ----------------------+----------------------------------------------------------------
  angry                 |
                  ANGER |   .7876821    .025169    31.30   0.000     .7383517    .8370125
                  _cons |   1.484379   .0540021    27.49   0.000     1.378537    1.590221
  ----------------------+----------------------------------------------------------------
  hostile               |
                  ANGER |   .7456826    .025889    28.80   0.000     .6949411    .7964241
                  _cons |    1.49908   .0543101    27.60   0.000     1.392634    1.605525
  ----------------------+----------------------------------------------------------------
  ashamed               |
                 NEGAFF |   .5877459   .0294468    19.96   0.000     .5300313    .6454606
                  _cons |   1.486329   .0539775    27.54   0.000     1.380535    1.592122
  ----------------------+----------------------------------------------------------------
  upset                 |
                 NEGAFF |   .7045967   .0244034    28.87   0.000     .6567669    .7524265
                  _cons |   1.687407   .0580159    29.09   0.000     1.573698    1.801116
  ----------------------+----------------------------------------------------------------
  distressed            |
                 NEGAFF |   .7892882   .0218428    36.13   0.000      .746477    .8320993
                  _cons |   1.650899   .0572916    28.82   0.000     1.538609    1.763188
------------------------+----------------------------------------------------------------
           var(e.afraid)|   .3905955   .0362622                      .3256141     .468545
          var(e.anxious)|   .4806318   .0356807                      .4155486    .5559083
            var(e.angry)|   .3795569   .0396504                      .3092831     .465798
          var(e.hostile)|   .4439575   .0386099                      .3743815    .5264636
          var(e.ashamed)|   .6545547   .0346145                      .5901091    .7260384
            var(e.upset)|   .5035435   .0343891                      .4404584    .5756641
       var(e.distressed)|   .3770242   .0344806                      .3151541    .4510404
               var(FEAR)|          1  (constrained)
              var(ANGER)|          1  (constrained)
             var(NEGAFF)|          1  (constrained)
------------------------+----------------------------------------------------------------
 cov(e.afraid,e.ashamed)|   .2452213   .0442049     5.55   0.000     .1585813    .3318613
  cov(e.angry,e.ashamed)|    .245465   .0532294     4.61   0.000     .1411373    .3497927
    cov(e.angry,e.upset)|   .2818384   .0494416     5.70   0.000     .1849347     .378742
cov(e.hostile,e.ashamed)|   .3594827   .0487306     7.38   0.000     .2639725    .4549929
         cov(FEAR,ANGER)|   .7203589   .0342937    21.01   0.000     .6531446    .7875732
        cov(FEAR,NEGAFF)|   .8890775   .0257231    34.56   0.000     .8386612    .9394938
       cov(ANGER,NEGAFF)|   .7813263     .03038    25.72   0.000     .7217827    .8408699
-----------------------------------------------------------------------------------------
LR test of model vs. saturated: chi2(7)   =     13.72, Prob > chi2 = 0.0563

. 
. *Study2
. use "study2_prepped.dta", clear

. sem (FEAR -> afraid anxious) (ANGER ->angry hostile) (NEGAFF-> upset distressed disturbed), /*
> */ var(FEAR@1 ANGER@1 NEGAFF@1) cov(e.upset*e.disturbed) cov(e.anxious*e.distressed) method(mlmv) standardized

Endogenous variables

Measurement:  afraid anxious angry hostile upset distressed disturbed

Exogenous variables

Latent:       FEAR ANGER NEGAFF

Fitting saturated model:

Iteration 0:   log likelihood = -10725.972  
Iteration 1:   log likelihood = -10725.906  
Iteration 2:   log likelihood = -10725.906  

Fitting baseline model:

Iteration 0:   log likelihood = -12638.107  
Iteration 1:   log likelihood = -12638.106  
Iteration 2:   log likelihood = -12638.106  

Fitting target model:

Iteration 0:   log likelihood = -10773.211  
Iteration 1:   log likelihood = -10761.179  
Iteration 2:   log likelihood = -10758.936  
Iteration 3:   log likelihood = -10758.931  
Iteration 4:   log likelihood = -10758.931  

Structural equation model                       Number of obs     =        987
Estimation method  = mlmv
Log likelihood     = -10758.931

 ( 1)  [/]var(FEAR) = 1
 ( 2)  [/]var(ANGER) = 1
 ( 3)  [/]var(NEGAFF) = 1
--------------------------------------------------------------------------------------------
                           |                 OIM
              Standardized |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
---------------------------+----------------------------------------------------------------
Measurement                |
  afraid                   |
                      FEAR |   .8708575   .0141394    61.59   0.000     .8431449    .8985701
                     _cons |    .892684   .0376515    23.71   0.000     .8188884    .9664795
  -------------------------+----------------------------------------------------------------
  anxious                  |
                      FEAR |   .7549697   .0171951    43.91   0.000     .7212679    .7886715
                     _cons |   1.052392   .0396967    26.51   0.000     .9745878    1.130196
  -------------------------+----------------------------------------------------------------
  angry                    |
                     ANGER |   .8836795   .0144581    61.12   0.000     .8553421    .9120169
                     _cons |   .8906303   .0376281    23.67   0.000     .8168807      .96438
  -------------------------+----------------------------------------------------------------
  hostile                  |
                     ANGER |   .7287128   .0182201    40.00   0.000     .6930021    .7644235
                     _cons |   .7760995   .0363084    21.38   0.000     .7049363    .8472628
  -------------------------+----------------------------------------------------------------
  upset                    |
                    NEGAFF |   .7994552   .0168201    47.53   0.000     .7664885     .832422
                     _cons |   1.130432   .0407917    27.71   0.000     1.050482    1.210382
  -------------------------+----------------------------------------------------------------
  distressed               |
                    NEGAFF |   .7554461   .0164382    45.96   0.000     .7232277    .7876645
                     _cons |   1.096076   .0402827    27.21   0.000     1.017124    1.175029
  -------------------------+----------------------------------------------------------------
  disturbed                |
                    NEGAFF |   .8165027   .0159055    51.33   0.000     .7853284    .8476769
                     _cons |   .9988366   .0389855    25.62   0.000     .9224264    1.075247
---------------------------+----------------------------------------------------------------
              var(e.afraid)|   .2416072   .0246267                      .1978555    .2950338
             var(e.anxious)|   .4300208   .0259636                      .3820287    .4840418
               var(e.angry)|   .2191106   .0255527                      .1743396    .2753788
             var(e.hostile)|   .4689776   .0265544                       .419716    .5240211
               var(e.upset)|   .3608713   .0268938                      .3118293    .4176264
          var(e.distressed)|   .4293012   .0248364                      .3832811    .4808468
           var(e.disturbed)|   .3333234   .0259738                      .2861126    .3883244
                  var(FEAR)|          1  (constrained)
                 var(ANGER)|          1  (constrained)
                var(NEGAFF)|          1  (constrained)
---------------------------+----------------------------------------------------------------
cov(e.anxious,e.distressed)|   .1927895   .0375987     5.13   0.000     .1190974    .2664817
   cov(e.upset,e.disturbed)|  -.1204415   .0596897    -2.02   0.044    -.2374312   -.0034518
            cov(FEAR,ANGER)|   .8151875   .0212913    38.29   0.000     .7734574    .8569176
           cov(FEAR,NEGAFF)|   .8666958   .0176012    49.24   0.000     .8321981    .9011934
          cov(ANGER,NEGAFF)|    .862979   .0176496    48.90   0.000     .8283864    .8975716
--------------------------------------------------------------------------------------------
LR test of model vs. saturated: chi2(9)   =     66.05, Prob > chi2 = 0.0000

. 
. *FIGURE A2
. use "study2_prepped.dta", clear

. reg anger i.treat##i.panasv

      Source |       SS           df       MS      Number of obs   =       987
-------------+----------------------------------   F(5, 981)       =     73.87
       Model |  235.620838         5  47.1241677   Prob > F        =    0.0000
    Residual |   625.84593       981  .637967309   R-squared       =    0.2735
-------------+----------------------------------   Adj R-squared   =    0.2698
       Total |  861.466768       986  .873698548   Root MSE        =    .79873

---------------------------------------------------------------------------------
          anger |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
          treat |
         anger  |   1.330117   .0889921    14.95   0.000      1.15548    1.504754
          fear  |   1.055317   .0897248    11.76   0.000     .8792423    1.231392
                |
         panasv |
      modified  |   .3785155   .0888743     4.26   0.000     .2041099    .5529212
                |
   treat#panasv |
anger#modified  |   -.351421   .1247093    -2.82   0.005    -.5961488   -.1066933
 fear#modified  |   -.628307   .1252332    -5.02   0.000    -.8740629   -.3825512
                |
          _cons |  -.8354896   .0652159   -12.81   0.000    -.9634683   -.7075108
---------------------------------------------------------------------------------

. margins, at(treat=(0 1 2) panasv = (1 2))

Adjusted predictions                            Number of obs     =        987
Model VCE    : OLS

Expression   : Linear prediction, predict()

1._at        : treat           =           0
               panasv          =           1

2._at        : treat           =           0
               panasv          =           2

3._at        : treat           =           1
               panasv          =           1

4._at        : treat           =           1
               panasv          =           2

5._at        : treat           =           2
               panasv          =           1

6._at        : treat           =           2
               panasv          =           2

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |  -.8354896   .0652159   -12.81   0.000    -.9634683   -.7075108
          2  |   -.456974   .0603782    -7.57   0.000    -.5754593   -.3384888
          3  |   .4946273   .0605515     8.17   0.000      .375802    .6134525
          4  |   .5217217    .063145     8.26   0.000     .3978069    .6456366
          5  |   .2198274   .0616232     3.57   0.000     .0988988    .3407559
          6  |  -.0299641    .063145    -0.47   0.635     -.153879    .0939507
------------------------------------------------------------------------------

. marginsplot, recast(scatter)

  Variables that uniquely identify margins: treat panasv

. 
. reg fear i.treat##i.panasv

      Source |       SS           df       MS      Number of obs   =       987
-------------+----------------------------------   F(5, 981)       =     83.64
       Model |  241.836694         5  48.3673388   Prob > F        =    0.0000
    Residual |   567.29042       981  .578277697   R-squared       =    0.2989
-------------+----------------------------------   Adj R-squared   =    0.2953
       Total |  809.127114       986  .820615735   Root MSE        =    .76045

---------------------------------------------------------------------------------
           fear |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
          treat |
         anger  |   1.268354   .0847267    14.97   0.000     1.102087     1.43462
          fear  |   1.257413   .0854243    14.72   0.000     1.089778    1.425049
                |
         panasv |
      modified  |   .3540528   .0846146     4.18   0.000     .1880064    .5200992
                |
   treat#panasv |
anger#modified  |   -.456977    .118732    -3.85   0.000     -.689975    -.223979
 fear#modified  |  -.4350241   .1192308    -3.65   0.000    -.6690009   -.2010472
                |
          _cons |  -.8823471   .0620901   -14.21   0.000    -1.004192   -.7605023
---------------------------------------------------------------------------------

. margins, at(treat=(0 1 2) panasv = (1 2))

Adjusted predictions                            Number of obs     =        987
Model VCE    : OLS

Expression   : Linear prediction, predict()

1._at        : treat           =           0
               panasv          =           1

2._at        : treat           =           0
               panasv          =           2

3._at        : treat           =           1
               panasv          =           1

4._at        : treat           =           1
               panasv          =           2

5._at        : treat           =           2
               panasv          =           1

6._at        : treat           =           2
               panasv          =           2

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |  -.8823471   .0620901   -14.21   0.000    -1.004192   -.7605023
          2  |  -.5282943   .0574843    -9.19   0.000    -.6411006   -.4154879
          3  |   .3860065   .0576492     6.70   0.000     .2728765    .4991365
          4  |   .2830823   .0601185     4.71   0.000     .1651066     .401058
          5  |   .3750662   .0586697     6.39   0.000     .2599337    .4901987
          6  |   .2940949   .0601185     4.89   0.000     .1761193    .4120706
------------------------------------------------------------------------------

. marginsplot, recast(scatter)

  Variables that uniquely identify margins: treat panasv

. 
. *A3: correlations of anger/fear and populism
. 
. by panasv, sort: pwcorr ppl anger fear

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> panasv = standard

             |      ppl    anger     fear
-------------+---------------------------
         ppl |   1.0000 
       anger |  -0.1084   1.0000 
        fear |  -0.0759   0.9139   1.0000 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> panasv = modified

             |      ppl    anger     fear
-------------+---------------------------
         ppl |   1.0000 
       anger |   0.0841   1.0000 
        fear |   0.0402   0.5815   1.0000 

. 
. *A4: Balance statistics
. *STUDY 1
. use "study1_prepped.dta", clear

. 
. gen region =.
(778 missing values generated)

. replace region = 1 if state == 1
(7 real changes made)

. replace region = 6 if state == 2
(0 real changes made)

. replace region = 5 if state == 3
(11 real changes made)

. replace region = 1 if state == 4
(3 real changes made)

. replace region = 4 if state == 5
(70 real changes made)

. replace region = 4 if state == 6
(3 real changes made)

. replace region = 2 if state == 7
(9 real changes made)

. replace region = 2 if state == 8
(0 real changes made)

. replace region = 2 if state == 9
(0 real changes made)

. replace region = 1 if state == 10
(80 real changes made)

. replace region = 1 if state == 11
(21 real changes made)

. replace region = 6 if state == 12
(2 real changes made)

. replace region = 4 if state == 13
(2 real changes made)

. replace region = 3 if state == 14
(20 real changes made)

. replace region = 3 if state == 15
(16 real changes made)

. replace region = 3 if state == 16
(3 real changes made)

. replace region = 3 if state == 17
(5 real changes made)

. replace region = 1 if state == 18
(12 real changes made)

. replace region = 1 if state == 19
(9 real changes made)

. replace region = 2 if state == 20
(1 real change made)

. replace region = 2 if state == 21
(10 real changes made)

. replace region = 2 if state == 22
(11 real changes made)

. replace region = 3 if state == 23
(15 real changes made)

. replace region = 3 if state == 24
(8 real changes made)

. replace region = 1 if state == 25
(7 real changes made)

. replace region = 3 if state == 26
(10 real changes made)

. replace region = 4 if state == 27
(2 real changes made)

. replace region = 3 if state == 28
(2 real changes made)

. replace region = 4 if state == 29
(8 real changes made)

. replace region = 2 if state == 30
(3 real changes made)

. replace region = 2 if state == 31
(29 real changes made)

. replace region = 5 if state == 32
(2 real changes made)

. replace region = 2 if state == 33
(80 real changes made)

. replace region = 1 if state == 34
(27 real changes made)

. replace region = 3 if state == 35
(0 real changes made)

. replace region = 3 if state == 36
(32 real changes made)

. replace region = 3 if state == 37
(7 real changes made)

. replace region = 3 if state == 38
(18 real changes made)

. replace region = 2 if state == 39
(25 real changes made)

. replace region = 6 if state == 40
(0 real changes made)

. replace region = 2 if state == 41
(2 real changes made)

. replace region = 1 if state == 42
(16 real changes made)

. replace region = 3 if state == 43
(1 real change made)

. replace region = 1 if state == 44
(14 real changes made)

. replace region = 5 if state == 45
(77 real changes made)

. replace region = 4 if state == 46
(7 real changes made)

. replace region = 2 if state == 47
(1 real change made)

. replace region = 1 if state == 48
(18 real changes made)

. replace region = 1 if state == 49
(18 real changes made)

. replace region = 1 if state == 50
(2 real changes made)

. replace region = 3 if state == 51
(14 real changes made)

. replace region = 4 if state == 52
(0 real changes made)

. 
. label define regionlab 1 "Southeast" 2 "Northeast" 3 "Midwest" 4 "West" 5 "Southwest" 6 "Non-continental US"

. label variable region regionlab 

. 
. replace age = 2018 - age
(751 real changes made)

. 
. tab gender treat, chi column taub

+-------------------+
| Key               |
|-------------------|
|     frequency     |
| column percentage |
+-------------------+

           |                         treat
    Gender |         0          1          2          3          4 |     Total
-----------+-------------------------------------------------------+----------
         0 |        95         86         83         79         73 |       416 
           |     62.09      56.21      54.25      56.83      56.59 |     57.22 
-----------+-------------------------------------------------------+----------
         1 |        57         66         69         59         56 |       307 
           |     37.25      43.14      45.10      42.45      43.41 |     42.23 
-----------+-------------------------------------------------------+----------
         2 |         1          1          1          1          0 |         4 
           |      0.65       0.65       0.65       0.72       0.00 |      0.55 
-----------+-------------------------------------------------------+----------
     Total |       153        153        153        139        129 |       727 
           |    100.00     100.00     100.00     100.00     100.00 |    100.00 

          Pearson chi2(8) =   3.0506   Pr = 0.931
          Kendall's tau-b =   0.0269  ASE = 0.033

. tab region treat, chi column taub

+-------------------+
| Key               |
|-------------------|
|     frequency     |
| column percentage |
+-------------------+

           |                         treat
 regionlab |         0          1          2          3          4 |     Total
-----------+-------------------------------------------------------+----------
         1 |        51         45         43         45         42 |       226 
           |     34.00      29.61      28.29      32.61      33.07 |     31.43 
-----------+-------------------------------------------------------+----------
         2 |        37         31         39         35         25 |       167 
           |     24.67      20.39      25.66      25.36      19.69 |     23.23 
-----------+-------------------------------------------------------+----------
         3 |        34         35         31         22         29 |       151 
           |     22.67      23.03      20.39      15.94      22.83 |     21.00 
-----------+-------------------------------------------------------+----------
         4 |        14         25         16         21         11 |        87 
           |      9.33      16.45      10.53      15.22       8.66 |     12.10 
-----------+-------------------------------------------------------+----------
         5 |        13         16         22         15         20 |        86 
           |      8.67      10.53      14.47      10.87      15.75 |     11.96 
-----------+-------------------------------------------------------+----------
         6 |         1          0          1          0          0 |         2 
           |      0.67       0.00       0.66       0.00       0.00 |      0.28 
-----------+-------------------------------------------------------+----------
     Total |       150        152        152        138        127 |       719 
           |    100.00     100.00     100.00     100.00     100.00 |    100.00 

         Pearson chi2(20) =  18.3624   Pr = 0.564
          Kendall's tau-b =   0.0168  ASE = 0.030

. reg ideology i.treat

      Source |       SS           df       MS      Number of obs   =       724
-------------+----------------------------------   F(4, 719)       =      0.39
       Model |  5.07969558         4  1.26992389   Prob > F        =    0.8184
    Residual |  2362.22832       719  3.28543577   R-squared       =    0.0021
-------------+----------------------------------   Adj R-squared   =   -0.0034
       Total |  2367.30801       723  3.27428494   Root MSE        =    1.8126

------------------------------------------------------------------------------
    ideology |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
          1  |    .122162   .2075768     0.59   0.556    -.2853671    .5296912
          2  |   .2171053   .2079169     1.04   0.297    -.1910914    .6253019
          3  |   .2303578   .2127227     1.08   0.279     -.187274    .6479896
          4  |    .151727   .2174447     0.70   0.486    -.2751753    .5786293
             |
       _cons |   3.309211   .1470194    22.51   0.000     3.020572    3.597849
------------------------------------------------------------------------------

. margins treat

Adjusted predictions                            Number of obs     =        724
Model VCE    : OLS

Expression   : Linear prediction, predict()

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
          0  |   3.309211   .1470194    22.51   0.000     3.020572    3.597849
          1  |   3.431373   .1465382    23.42   0.000     3.143679    3.719066
          2  |   3.526316   .1470194    23.99   0.000     3.237677    3.814954
          3  |   3.539568   .1537408    23.02   0.000     3.237734    3.841403
          4  |   3.460938   .1602107    21.60   0.000     3.146401    3.775474
------------------------------------------------------------------------------

. reg ed i.treat

      Source |       SS           df       MS      Number of obs   =       726
-------------+----------------------------------   F(4, 721)       =      0.60
       Model |  4.12232327         4  1.03058082   Prob > F        =    0.6594
    Residual |  1228.76473       721  1.70425066   R-squared       =    0.0033
-------------+----------------------------------   Adj R-squared   =   -0.0022
       Total |  1232.88705       725  1.70053387   Root MSE        =    1.3055

------------------------------------------------------------------------------
          ed |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
          1  |   .1353199   .1495027     0.91   0.366    -.1581928    .4288326
          2  |  -.0476866   .1495027    -0.32   0.750    -.3411993    .2458261
          3  |   .1284078   .1532089     0.84   0.402    -.1723811    .4291967
          4  |   .1070481   .1562799     0.68   0.494      -.19977    .4138663
             |
       _cons |   4.296053   .1058876    40.57   0.000     4.088168    4.503937
------------------------------------------------------------------------------

. margins treat

Adjusted predictions                            Number of obs     =        726
Model VCE    : OLS

Expression   : Linear prediction, predict()

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
          0  |   4.296053   .1058876    40.57   0.000     4.088168    4.503937
          1  |   4.431373    .105541    41.99   0.000     4.224168    4.638577
          2  |   4.248366    .105541    40.25   0.000     4.041162     4.45557
          3  |    4.42446   .1107285    39.96   0.000     4.207072    4.641849
          4  |   4.403101   .1149402    38.31   0.000     4.177443    4.628758
------------------------------------------------------------------------------

. reg income i.treat

      Source |       SS           df       MS      Number of obs   =       723
-------------+----------------------------------   F(4, 718)       =      0.51
       Model |  18.1241508         4  4.53103771   Prob > F        =    0.7285
    Residual |  6380.03629       718  8.88584442   R-squared       =    0.0028
-------------+----------------------------------   Adj R-squared   =   -0.0027
       Total |  6398.16044       722  8.86171806   Root MSE        =    2.9809

------------------------------------------------------------------------------
      income |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
          1  |  -.2368421   .3419342    -0.69   0.489    -.9081525    .4344683
          2  |  -.0921053   .3419342    -0.27   0.788    -.7634156    .5792051
          3  |  -.3986461   .3504992    -1.14   0.256    -1.086772    .2894797
          4  |  -.3927479   .3568501    -1.10   0.271    -1.093342    .3078465
             |
       _cons |   5.927632    .241784    24.52   0.000     5.452943     6.40232
------------------------------------------------------------------------------

. margins treat

Adjusted predictions                            Number of obs     =        723
Model VCE    : OLS

Expression   : Linear prediction, predict()

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
          0  |   5.927632    .241784    24.52   0.000     5.452943     6.40232
          1  |   5.690789    .241784    23.54   0.000     5.216101    6.165478
          2  |   5.835526    .241784    24.14   0.000     5.360838    6.310214
          3  |   5.528986   .2537522    21.79   0.000     5.030801     6.02717
          4  |   5.534884   .2624548    21.09   0.000     5.019613    6.050154
------------------------------------------------------------------------------

. reg age i.treat

      Source |       SS           df       MS      Number of obs   =       730
-------------+----------------------------------   F(4, 725)       =      1.23
       Model |  624.869002         4  156.217251   Prob > F        =    0.2964
    Residual |  92043.6529       725  126.956763   R-squared       =    0.0067
-------------+----------------------------------   Adj R-squared   =    0.0013
       Total |  92668.5219       729  127.117314   Root MSE        =    11.268

------------------------------------------------------------------------------
         age |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
          1  |  -1.350649   1.284052    -1.05   0.293    -3.871553    1.170254
          2  |   .7784568   1.286148     0.61   0.545    -1.746563    3.303476
          3  |  -1.461039   1.315762    -1.11   0.267    -4.044197    1.122119
          4  |  -1.437229   1.344825    -1.07   0.286    -4.077447    1.202988
             |
       _cons |    37.1039   .9079618    40.87   0.000     35.32135    38.88644
------------------------------------------------------------------------------

. margins treat

Adjusted predictions                            Number of obs     =        730
Model VCE    : OLS

Expression   : Linear prediction, predict()

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
          0  |    37.1039   .9079618    40.87   0.000     35.32135    38.88644
          1  |   35.75325   .9079618    39.38   0.000      33.9707    37.53579
          2  |   37.88235   .9109241    41.59   0.000     36.09399    39.67072
          3  |   35.64286   .9522783    37.43   0.000      33.7733    37.51241
          4  |   35.66667   .9920489    35.95   0.000     33.71904     37.6143
------------------------------------------------------------------------------

. 
. *STUDY2
. use "study2_prepped.dta", clear

. 
. label define regionlab 1 "Southeast" 2 "Northeast" 3 "Midwest" 4 "West" 5 "Southwest" 6 "Non-continental US"

. label variable region regionlab 

. 
. sum age

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         age |        987    36.64336    11.07967         19         77

. 
. tab gender treat, chi column taub

+-------------------+
| Key               |
|-------------------|
|     frequency     |
| column percentage |
+-------------------+

           |              treat
    Gender |   control      anger       fear |     Total
-----------+---------------------------------+----------
         0 |       168        177        168 |       513 
           |     51.69      52.99      51.38 |     52.03 
-----------+---------------------------------+----------
         1 |       155        157        158 |       470 
           |     47.69      47.01      48.32 |     47.67 
-----------+---------------------------------+----------
         2 |         2          0          1 |         3 
           |      0.62       0.00       0.31 |      0.30 
-----------+---------------------------------+----------
     Total |       325        334        327 |       986 
           |    100.00     100.00     100.00 |    100.00 

          Pearson chi2(4) =   2.2036   Pr = 0.698
          Kendall's tau-b =   0.0013  ASE = 0.030

. tab region treat, chi column taub

+-------------------+
| Key               |
|-------------------|
|     frequency     |
| column percentage |
+-------------------+

           |              treat
 regionlab |   control      anger       fear |     Total
-----------+---------------------------------+----------
         1 |       113        105         91 |       309 
           |     34.77      31.44      27.83 |     31.34 
-----------+---------------------------------+----------
         2 |        68         66         64 |       198 
           |     20.92      19.76      19.57 |     20.08 
-----------+---------------------------------+----------
         3 |        77         68         74 |       219 
           |     23.69      20.36      22.63 |     22.21 
-----------+---------------------------------+----------
         4 |        40         51         59 |       150 
           |     12.31      15.27      18.04 |     15.21 
-----------+---------------------------------+----------
         5 |        26         40         39 |       105 
           |      8.00      11.98      11.93 |     10.65 
-----------+---------------------------------+----------
         6 |         1          4          0 |         5 
           |      0.31       1.20       0.00 |      0.51 
-----------+---------------------------------+----------
     Total |       325        334        327 |       986 
           |    100.00     100.00     100.00 |    100.00 

         Pearson chi2(10) =  15.3174   Pr = 0.121
          Kendall's tau-b =   0.0700  ASE = 0.026

. reg ideology i.treat

      Source |       SS           df       MS      Number of obs   =       981
-------------+----------------------------------   F(2, 978)       =      0.92
       Model |  6.41840234         2  3.20920117   Prob > F        =    0.3983
    Residual |  3406.62747       978  3.48325917   R-squared       =    0.0019
-------------+----------------------------------   Adj R-squared   =   -0.0002
       Total |  3413.04587       980  3.48269987   Root MSE        =    1.8663

------------------------------------------------------------------------------
    ideology |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
      anger  |   .1283916   .1458528     0.88   0.379    -.1578289    .4146121
       fear  |  -.0660311   .1462962    -0.45   0.652    -.3531216    .2210593
             |
       _cons |   3.526154   .1035264    34.06   0.000     3.322994    3.729313
------------------------------------------------------------------------------

. margins treat

Adjusted predictions                            Number of obs     =        981
Model VCE    : OLS

Expression   : Linear prediction, predict()

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
    control  |   3.526154   .1035264    34.06   0.000     3.322994    3.729313
      anger  |   3.654545   .1027391    35.57   0.000     3.452931     3.85616
       fear  |   3.460123   .1033675    33.47   0.000     3.257275     3.66297
------------------------------------------------------------------------------

. reg ed i.treat

      Source |       SS           df       MS      Number of obs   =       984
-------------+----------------------------------   F(2, 981)       =      0.07
       Model |  .232173641         2   .11608682   Prob > F        =    0.9349
    Residual |  1690.72718       981  1.72347317   R-squared       =    0.0001
-------------+----------------------------------   Adj R-squared   =   -0.0019
       Total |  1690.95935       983   1.7202028   Root MSE        =    1.3128

------------------------------------------------------------------------------
          ed |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
      anger  |   .0371205   .1024449     0.36   0.717    -.1639159    .2381568
       fear  |   .0136199   .1029073     0.13   0.895     -.188324    .2155637
             |
       _cons |   4.182099    .072934    57.34   0.000     4.038974    4.325223
------------------------------------------------------------------------------

. margins treat

Adjusted predictions                            Number of obs     =        984
Model VCE    : OLS

Expression   : Linear prediction, predict()

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
    control  |   4.182099    .072934    57.34   0.000     4.038974    4.325223
      anger  |   4.219219   .0719416    58.65   0.000     4.078042    4.360396
       fear  |   4.195719   .0725986    57.79   0.000     4.053252    4.338185
------------------------------------------------------------------------------

. reg income i.treat

      Source |       SS           df       MS      Number of obs   =       986
-------------+----------------------------------   F(2, 983)       =      2.35
       Model |  44.5917079         2   22.295854   Prob > F        =    0.0958
    Residual |  9320.31296       983  9.48149843   R-squared       =    0.0048
-------------+----------------------------------   Adj R-squared   =    0.0027
       Total |  9364.90467       985  9.50751743   Root MSE        =    3.0792

------------------------------------------------------------------------------
      income |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
      anger  |   .2860617   .2399199     1.19   0.233    -.1847524    .7568758
       fear  |   .5222865    .241183     2.17   0.031     .0489937    .9955793
             |
       _cons |   5.606154   .1708035    32.82   0.000     5.270972    5.941335
------------------------------------------------------------------------------

. margins treat

Adjusted predictions                            Number of obs     =        986
Model VCE    : OLS

Expression   : Linear prediction, predict()

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
    control  |   5.606154   .1708035    32.82   0.000     5.270972    5.941335
      anger  |   5.892216   .1684866    34.97   0.000     5.561581     6.22285
       fear  |    6.12844   .1702804    35.99   0.000     5.794286    6.462595
------------------------------------------------------------------------------

. reg age i.treat

      Source |       SS           df       MS      Number of obs   =       987
-------------+----------------------------------   F(2, 984)       =      0.00
       Model |  1.05867864         2  .529339322   Prob > F        =    0.9957
    Residual |  121039.405       984  123.007526   R-squared       =    0.0000
-------------+----------------------------------   Adj R-squared   =   -0.0020
       Total |  121040.464       986  122.759091   Root MSE        =    11.091

------------------------------------------------------------------------------
         age |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
      anger  |   .0737356    .864159     0.09   0.932    -1.622071    1.769542
       fear  |   .0646623   .8680482     0.07   0.941    -1.638776    1.768101
             |
       _cons |   36.59692   .6152111    59.49   0.000     35.38965     37.8042
------------------------------------------------------------------------------

. margins treat

Adjusted predictions                            Number of obs     =        987
Model VCE    : OLS

Expression   : Linear prediction, predict()

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       treat |
    control  |   36.59692   .6152111    59.49   0.000     35.38965     37.8042
      anger  |   36.67066   .6068657    60.43   0.000     35.47976    37.86156
       fear  |   36.66159   .6123912    59.87   0.000     35.45984    37.86333
------------------------------------------------------------------------------

. 
. log close
      name:  <unnamed>
       log:  F:\Dropbox\School\Research Projects\Populism\Analysis\PANAS PAPER\Replication code\analysis.log
  log type:  text
 closed on:   4 Dec 2019, 16:23:42
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
